package InputStream;import java.io.*;public class PrinWriterTest {    public static void main(String[] args) {        try{            PrintWriter out = new PrintWriter(new FileWriter("myAccount2.dat"));            BankAccount aBankAccount = new BankAccount("LiuWei", 3000);            out.println(aBankAccount.getOwnerName());            out.println(aBankAccount.getAccountNumber());            out.println(aBankAccount.getBalance());            out.close();        }catch(FileNotFoundException e){            System.out.println("不能打开文件来写");        }catch(IOException e){            System.out.println("不能写");        }    }}